/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mz2d.render;


import java.awt.Frame;
import java.awt.Graphics;

/**
 *
 * @author christian Fyrvik
 */
public class MZ2DFrame extends Frame {

    /**
     * Width and height of the frame
     */
    private int width,  height;
    /**
     * The applet reference for the "update" method
     */
    private MZ2DApplet gameApplet;

    public MZ2DFrame(MZ2DApplet gameApplet, int width, int height) {
        this.gameApplet = gameApplet;
        this.width = width;
        this.height = height;
        setResizable(false);
        setVisible(true);
        toFront();
        setSize(width + 8, height + 24);
    }

    public Graphics getGraphics() {
        Graphics g = super.getGraphics();
        g.translate(4, 24);
        return g;
    }

    public void update(Graphics g) {
        gameApplet.update(g);
    }

    public void paint(Graphics g) {
        gameApplet.paint(g);
    }
}
